﻿/*
 * ======================================================================
 *                           Modern Warfare3 Launcher
 * Copyright 2011-2012
 * Developer:Pooya parsa
 * Email:pingsft@gmail.com
 * You are ALLOWED:
 * -Read source code
 * -Use some part of source code with Full name and email of developer
 * -Release your own mod with name of develepor
 * You are NOT ALLOWD:
 * -Add cracked version of Mw3
 * -Release modified version as MW3Launcher
 * -Mirror Sourcecode
 * -Use source code without name of developer
 * Thank you for your attention
 * ======================================================================
 * */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MW3Launcher
{
    public partial class UpdaterFrm : Form
    {
        public UpdaterFrm()
        {
            InitializeComponent();
        }

        private void updater1_Load(object sender, EventArgs e)
        {
            updater1.StartUpdate();
    
        }

        private void updater1_StatusChanged()
        {
            switch (updater1.Operation)
            {
                case Updater.Operation_e.error:
                    if (MessageBox.Show("Error.Do tou want to retry?", "Error", MessageBoxButtons.RetryCancel) == System.Windows.Forms.DialogResult.Retry)
                        updater1.StartUpdate();
                    else
                        Environment.Exit(0);
                    break;
                case Updater.Operation_e.finished:
                    Environment.Exit(0);
                    break;
                case Updater.Operation_e.updatestarting:
                    break;
            }
        }
    }
}
